<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#include file="json.asp"-->
<%
'打开数据库连接
dim conn,connstr,db,rs
db="databases.mdb"
Set conn = Server.CreateObject("ADODB.Connection")

connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")

conn.Open connstr
%>
<%
dim json : set json = jsObject()
dim list : set list = jsArray()
dim val,item

val=Request("val")

Response.ContentType = "text/json"
set rs=conn.execute("select * from major where college_id = "&val)


set json("data") = list
Do while not (rs.eof or rs.bof)
				set list(null) = jsObject()
				for each item in rs.fields
					list(null)(item.Name) = item.Value
				next
				rs.movenext
Loop	
Response.Write(json.jsString)
%>